#
# perc2 - calculation of the fractal dimension of correlated
# bond percolation cluster hulls
#
# Copyright (C) 2009, 2010 Indrek Mandre <indrek(at)mare.ee>
# http://www.mare.ee/indrek/perc2/, http://code.google.com/p/perc2/
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# 

# Prints out a B&W path outlined to a grayscale surface data

set terminal postscript eps dl 0.5
set output 'printout.eps'

unset xtics
unset ytics
unset ztics
unset key
unset cbtics
unset colorbox
unset clabel

set size ratio -1

set bmargin 0; set lmargin 0; set rmargin 0; set tmargin 0

unset border

#set view 0,0

#set pm3d interpolate 8,8

#set cbrange [-1:1]

set view map

#set pm3d corners2color c1

phi=pi/4
midx = 4096
fc(p)=p-midx
rotx(x,y)=fc(x)*cos(phi)-fc(y)*sin(phi)
roty(x,y)=fc(x)*sin(phi)+fc(y)*cos(phi)

splot \
    'printout_path.csv' using (rotx($1,$2)):(roty($1,$2)):(0) with lines lw 0.001 lt 1, \
    'printout_grid.csv' using (rotx($1,$2)):(roty($1,$2)):(0) with lines lw 1 lt 1, \
    'printout_perimpath.csv' using (rotx($1,$2)):(roty($1,$2)):(0) with lines lw 0.001 lt 3, \
    'printout_mypath.csv' using (-sqrt(2)*$2):(sqrt(2)*($1+0.5)):(0) with linespoints lt 3 lw 0.001 pt 5 ps 0.33

#    'printout_mypath.csv' using (rotx($1,$2)):(roty($1,$2)):(0) with points pt 5 ps 0.33

